package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.MerchantDeductionsStatus;
import com.rockcent.mall.lib.domain.enumclass.MerchantDeductionsType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * 商户服务费扣费流水
 * Created by zhangjh on 2017/4/5.
 */
@Entity
@Table(name = "merchant_deduction_flow")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class MerchantDeductionsFlow extends IDEntityMall {
    /**
     * 流水号
     */
    @Column(columnDefinition = "varchar(100) comment '流水号'")
    private String seqNo;

    /**
     * 商户ID
     */
    @Column(columnDefinition = "bigint(20) comment '商户ID'")
    private Long merchantId;

    /**
     * 平台ID
     */
    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    /**
     * 金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '金额'")
    private BigDecimal operationAmount;

    /**
     * 扣费状态
     */
    @Column(columnDefinition = "varchar(30) comment '扣费状态 SUCCESS(\"扣费成功\"),FAIL(\"扣费失败\")'")
    @Enumerated(EnumType.STRING)
    private MerchantDeductionsStatus deductionsStatus;


    /**
     * 扣费类型
     */
    @Column(columnDefinition = "varchar(30) comment '支付类型 ALL(\"全部\"), BASE_SERVICE_PAYMENTS(\"基础服务费扣费\")'")
    @Enumerated(EnumType.STRING)
    private MerchantDeductionsType deductionsType;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(100)  comment '备注'")
    private String remark;


    /**
     * 结算日
     */
    @Column(columnDefinition = "varchar(30)  comment '结算日'")
    private String settlementDate;


    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public BigDecimal getOperationAmount() {
        return operationAmount;
    }

    public void setOperationAmount(BigDecimal operationAmount) {
        this.operationAmount = operationAmount;
    }

    public MerchantDeductionsStatus getDeductionsStatus() {
        return deductionsStatus;
    }

    public void setDeductionsStatus(MerchantDeductionsStatus deductionsStatus) {
        this.deductionsStatus = deductionsStatus;
    }

    public MerchantDeductionsType getDeductionsType() {
        return deductionsType;
    }

    public void setDeductionsType(MerchantDeductionsType deductionsType) {
        this.deductionsType = deductionsType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getSettlementDate() {
        return settlementDate;
    }

    public void setSettlementDate(String settlementDate) {
        this.settlementDate = settlementDate;
    }

    @Override
    public String toString() {
        return "MerchantDeductionsFlow{" +
                "id=" + id +
                ", seqNo='" + seqNo + '\'' +
                ", dateCreated=" + dateCreated +
                ", merchantId=" + merchantId +
                ", lastUpdated=" + lastUpdated +
                ", mallId=" + mallId +
                ", isDelete=" + isDelete +
                ", operationAmount=" + operationAmount +
                ", version=" + version +
                ", deductionsStatus=" + deductionsStatus +
                ", deductionsType=" + deductionsType +
                ", remark='" + remark + '\'' +
                ", settlementDate='" + settlementDate + '\'' +
                '}';
    }
}
